let payOrderDao = require('../dao/payOrderDao');

const { BusiError, SysError } = require('../exception/exception');

class PayOrderService {
    constructor() {

    }

    /**
     * 
     * @param {{
     *  uid:String,  // 用户uid
     *  name: String, // 用户名称
     *  mobile: String,  // 用户手机号
     *  payChannel: String,  // 支付渠道
     *  status: Number,  // 订单状态
     *  flowNo: String,  // 流水号
     *  page: Number}} cond   
     */
    async queryPayOrder(cond){
        let cnt = await payOrderDao.queryByCondCnt(cond);
        if(cnt === 0){
            return {data: [], cnt: 0};
        }

        let data = await payOrderDao.queryByCond(cond);
        return {data: data, cnt: cnt};
    }
}

let payOrderService = new PayOrderService();
module.exports = payOrderService;
